package com.acwing.partition43;

import java.io.*;

/**
 * @author `RKC`
 * @date 2022/6/14 15:37
 */
public class AC4268性感素数 {

    private static StreamTokenizer tokenizer = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    private static PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        int n = nextInt();
        for (int i = n - 6; i <= n + 6; i += 12) {
            if (isPrime(i) && isPrime(n)) {
                writer.println("Yes");
                writer.println(i);
                writer.flush();
                return;
            }
        }
        for (int i = n + 1; ; i++) {
            if (isPrime(i) && (isPrime(i - 6) || isPrime(i + 6))) {
                writer.println("No");
                writer.println(i);
                writer.flush();
                return;
            }
        }
    }

    private static boolean isPrime(int x) {
        if (x < 2) return false;
        for (int i = 2; i <= x / i; i++) {
            if (x % i == 0) return false;
        }
        return true;
    }

    private static int nextInt() throws IOException {
        tokenizer.nextToken();
        return (int) tokenizer.nval;
    }
}
